program Task_2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  massx1, massy1, massx2, massy2: array of Integer;
  n1, n2, i: Integer;
  xcm, ycm, dS, dS0: Real;
  fin: TextFile;

begin
  AssignFile (fin, 'input.txt');
  Reset (fin);
  Readln (fin, n1);
  SetLength (massx1, n1);
  SetLength (massy1, n1);
  xcm:=0;
  ycm:=0;
  for i:=0 to n1-1 do
  begin
    readln (fin, massx1[i], massy1[i]);
    xcm:=xcm+massx1[i];
    ycm:=ycm+massy1[i];
  end;
  xcm:=xcm/n1;
  ycm:=ycm/n1;
  readln (fin, n2);
  SetLength (massx2, n2+1);
  SetLength (massy2, n2+1);
  for i:=0 to n2-1 do
  begin
    readln (fin, massx2[i], massy2[i]);
  end;
  massx2[n2]:=massx2[0];
  massy2[n2]:=massy2[0];
  massx2[n2+1]:=massx2[1];
  massy2[n2+1]:=massy2[1];
  massx2[n2+2]:=massx2[2];
  massy2[n2+2]:=massy2[2];
  for i:=0 to n2-1 do
  begin
    dS:=dS+abs(massx2[i]*massy2[i+1]-massx2[i+1]*massy2[i]);
  end;
  for i:=0 to n2+1 do
  begin
    dS0:=dS0+abs(xcm*massy2[i]-massx2[i]*ycm+massx2[i]*massy2[i+1]-massx2[i+1]*massy2[i]+massx2[i+1]*ycm-xcm*massy2[i+1]);
  end;
  Writeln (dS, dS0);
  Readln;
  if (dS=dS0) then
  begin
    Writeln ('yes.');
  end else begin
    Writeln ('no.');
  end;
  readln;
  CloseFile (fin);
end.

